package com.gs.security.core.validate.validatecode;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @Author gaoshi
 * 验证码
 *
 */
@Data
public class ValidateCode {
    private String code;
    private LocalDateTime expireTime;

    public ValidateCode(String code,int expireTime)
    {
        this.code =code;
        this.expireTime = LocalDateTime.now().plusSeconds(expireTime);
    }
    public boolean isExpried() {
        return LocalDateTime.now().isAfter(expireTime);
    }

}
